package com.wxd.framework.common.web.Interceptor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LogInterceptor implements MethodInterceptor{

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		Logger loger = LoggerFactory.getLogger(invocation.getClass());
       
        loger.info("--Log By Andy Chan -----------------------------------------------------------------------------");  
        loger.info(invocation.getMethod() + ":BEGIN!--(Andy ChanLOG)");//方法前的操作  
        Object obj = invocation.proceed();// 执行需要Log的方法  
        loger.info(invocation.getMethod() + ":END!--(Andy ChanLOG)");//方法后的操作  
        loger.info("-------------------------------------------------------------------------------------------------");  
  
        return obj;  
	}

}
